/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout'

const adminRouter = [
  {
    path: '/admin/workPoint',
    component: Layout,
    meta: { roles: ['supper'] },
    children: [
      {
        path: '',
        component: () => import('@/views/workPoint/index'),
        name: 'WorkPoint',
        meta: { title: '工点管理' }
      }
    ]
  },
  {
    path: '/admin/client',
    component: Layout,
    meta: { roles: ['supper'] },
    children: [
      {
        path: '',
        component: () => import('@/views/clientManage/ClientManage'),
        name: 'Client',
        meta: { title: '客户端管理' }
      }
    ]
  },
  {
    path: '/admin/userRoles',
    component: Layout,
    meta: { roles: ['admin', 'supper'], title: '用户权限' },
    children: [
      // {
      //   path: 'unit',
      //   // component: () => import('@/views/workPoint/index'),
      //   name: 'Unit',
      //   meta: { title: '单位组织管理' }
      // },
      {
        path: 'user',
        component: () => import('@/views/manager/Manager'),
        name: 'User',
        meta: { title: '用户管理' }
      },
      {
        path: 'roles',
        component: () => import('@/views/role/Role'),
        name: 'Roles',
        meta: { title: '单位组织管理' }
      }
    ]
  },
  {
    path: '/admin/system',
    component: Layout,
    meta: { roles: ['admin', 'supper'], title: '系统设置' },
    children: [
      {
        path: 'authorized',
        component: () => import('@/views/systemSettings/interface'),
        name: 'Authorized',
        roles: ['supper'],
        meta: { roles: ['supper'], title: '授权信息管理' }
      },
      {
        path: 'backup',
        component: () => import('@/views/dataBackups/index'),
        name: 'Backup',
        meta: { roles: ['supper'], title: '数据备份' }
      },
      {
        path: 'interface',
        component: () => import('@/views/systemSettings/interface'),
        name: 'Interface',
        meta: { roles: ['supper'], title: '开放接口' }
      },
      {
        path: 'log',
        component: () => import('@/views/systemSettings/Log'),
        name: 'Log',
        meta: { roles: ['admin', 'supper'], title: '操作日志' }
      }
    ]
  }
]

export default adminRouter
